package cn.zn.modules.invoice.service.impl;

import cn.zn.modules.invoice.inter.InvoiceRecordInfoInter;
import cn.zn.modules.invoice.inter.vo.InvoiceVO;
import cn.zn.modules.invoice.service.InvoiceDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

@Service("invoiceRecordInfoInter")
public class InvoiceRecordInfoInterImpl implements InvoiceRecordInfoInter {
    @Autowired
    private InvoiceDetailService invoiceDetailService;

    @Override
    public List<InvoiceVO> findInvoice(String applyCode) {
        return invoiceDetailService.queryList(applyCode).stream().map(o->InvoiceVO.builder()
                .code(o.getCode())
                .number(o.getNumber())
                .build()).collect(Collectors.toList());
    }

    @Override
    public void copyInvoice(String oldApplyCode, String newApplyCode, Boolean canEdit) {

    }
}
